
$(function () {
    /*用户数据分页*/
    var pageStr = location.search.substr(1);
    var searchArr = pageStr.split("&");
    var serObj = {};
    $.each(searchArr, function (index, val) {
        serObj[val.split("=")[0]] = val.split("=")[1]
    });
    /*获取总页数*/
    var allPage = ($("#page").attr("data-allPage")) - 0;
    if (serObj.page > allPage) {
        serObj.page = allPage;
    } else if (serObj.page < 1) {
        serObj.page = 1;
    }
    /*获取总条数*/
    var allStrip = ($("#page").attr("data-strip")) - 0;

    $("#page").paging({
        pageNo: serObj.page,
        totalPage: allPage,
        totalSize: allStrip,
        callback: function (num) {
            location.href = location.origin + location.pathname + "?page=" + num;
        }
    });
});